
#ifndef GMACHINE_HEADER_GREGISTER_H
#define GMACHINE_HEADER_GREGISTER_H

#include "GProfile.h"
#include "GObjects.h"

namespace GMachine
{
	///////////////////////////////////////////////////////////////
	// Register
	///////////////////////////////////////////////////////////////
	struct GRegister 
	{
		//---------------------------------------------------------
		//	USER Register
		//---------------------------------------------------------
	public:
		// 256 Handle registers
		HandleObject	H[256];
		// 256 Integer registers
		IntegerObject	G[256];
		// 256 Floating registers
		FloatingObject	F[256];
		// 256 String registers
		StringObject	S[256];

		//---------------------------------------------------------
		//	Constructor
		//---------------------------------------------------------
	public:
		GRegister()
		{
			memset(H, 0, sizeof(H));
			memset(G, 0, sizeof(G));
			memset(F, 0, sizeof(F));
			memset(S, 0, sizeof(S));
		}

	private:IntegerObject	invalidGReg;
	public:	IntegerObject*	GetInvalidGReg() 
			{ 
				//throw();
				printf("Get GREG failed.\n");
				return &invalidGReg; 
			}

	private:FloatingObject	invalidFReg;
	public:	FloatingObject*	GetInvalidFReg() 
			{ 
				//throw();
				printf("Get FREG failed.\n");
				return &invalidFReg; 
			}

	private:StringObject	invalidSReg;
	public:	StringObject*	GetInvalidSReg() 
			{ 
				//throw();
				printf("Get SREG failed.\n");
				return &invalidSReg; 
			}

	private:HandleObject	invalidHReg;
	public:	HandleObject*	GetInvalidHReg() 
			{
				//throw();
				printf("Get HREG failed.\n");
				return &invalidHReg; 
			}
	};
}

#endif	//ifndef GMACHINE_HEADER_GREGISTER_H

